package com.wang;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import com.wang.auto.AutoSend;
import com.wang.auto.AutoTask;
import com.wang.auto.InitDataTask;
import com.wang.auto.NettyBooter;
import com.wang.auto.addSet.AddSetAutoSend;
import com.wang.conf.AppConf;
import com.wang.socket.NettySocketServer;
import com.wang.util.DateUtil;
import com.wang.util.SpringUtil;
import com.wang.webSocket.NettyWebSocketServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;


@ServletComponentScan
@SpringBootApplication
public class DataonlineTcpSocketApplication implements CommandLineRunner {



    public static void main(String[] args) {
        SpringApplication.run(DataonlineTcpSocketApplication.class, args);

    }


    @Override
    public void run(String... args) throws Exception {
        InitDataTask.init();

        //自动检测设备 心跳包
        AutoTask autoTask = new AutoTask();
        autoTask.init();

        System.out.println("------------------------------");
        AutoSend autoSend = new AutoSend();
        autoSend.init();

        try {
            Thread.sleep(6000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        NettyBooter nettyBooter = new NettyBooter();
        nettyBooter.start();

        AddSetAutoSend.init();
    }
}
